<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
/*******basic*******/
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		$jy_gohome=plugin('jy_gohome')->plugin_setting('basic');
		$jy_gohome['jy_area_agent']=$postdata['jy_area_agent'];
		$jy_gohome['jy_teamfee']=$postdata['jy_teamfee'];
		$jy_gohome['jy_commission']=$postdata['jy_commission'];
		plugin('jy_gohome')->plugin_setting('basic',$jy_gohome);
		exi('设置成功');
	}
	$footernav =array(
		array('title'=>'首页','icon'=>'icon-shouye','action'=>'jy_gohomespaone/index/'),
		array('title'=>'项目','icon'=>'icon-all','action'=>'jy_gohome/sever/'),
		array('title'=>'订单','icon'=>'icon-dingdan','action'=>'jy_gohome/order/'),
		array('title'=>'我的','icon'=>'icon-wo1','action'=>'jy_gohome/home/'),
	);
	$hdps =array(
		array('title'=>'1','picurl'=>'../addons/jy_gohomespaone/resource/images/hdp01.jpg'),
		array('title'=>'2','picurl'=>'../addons/jy_gohomespaone/resource/images/hdp02.jpg'),
	);
	$return['item']=$this->plugin_setting('basic');
	$return['item']['footernav']=$return['item']['footernav']?$return['item']['footernav']:$footernav;
	$return['item']['hdps']=$return['item']['hdps']?$return['item']['hdps']:$hdps;
	$jy_gohome=plugin('jy_gohome')->plugin_setting('basic');
	$return['item']['jy_area_agent']=$jy_gohome['jy_area_agent'];
	$return['item']['jy_teamfee']=$jy_gohome['jy_teamfee'];
	$return['item']['jy_commission']=$jy_gohome['jy_commission'];
	$fenxiaoset=array(
		array('type'=>'tip','title'=>'[温馨提示]：需要安装对应的分销插件，才显示开启！'),
	);
	if($this->plugin_exists('jy_area_agent')){
		$fenxiaoset[]=array('type'=>'switch','title'=>'是否启用区域代理？','name'=>'jy_area_agent','isradio'=>1);
	}
	if($this->plugin_exists('jy_teamfee')){
		$fenxiaoset[]=array('type'=>'switch','title'=>'是否启用团长极差分红？','name'=>'jy_teamfee','isradio'=>1);
	}
	if($this->plugin_exists('jy_commission')){
		$fenxiaoset[]=array('type'=>'switch','title'=>'是否启用微客分销？','name'=>'jy_commission','isradio'=>1);
	}
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基本信息',
				'list'=>array(
					array('type'=>'string','title'=>'网站名称','name'=>'title'),
					array('type'=>'image','title'=>'网站logo','name'=>'logo'),
					array('type'=>'string','title'=>'分享标题','name'=>'share_title'),
					array('type'=>'image','title'=>'分享图片','name'=>'share_image'),
					array('type'=>'string','title'=>'分享描述','name'=>'share_desc'),
				)
			),
			array(
					'title'=>'分销设置',
					'list'=>$fenxiaoset
			),
			array(
				'title'=>'幻灯片',
					'list'=>array(
						array(
							'type'=>'array',
							'name'=>'hdps',
							'add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片'),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'幻灯片图片','help'=>''),
									array('type'=>'string','name'=>'url','title'=>'幻灯片链接'),
									
								)
						)
					)
			),
			array(
				'title'=>'板块导航',
					'list'=>array(
									array('type'=>'array','name'=>'bankuai','add_tip'=>'添加一个板块导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'image','name'=>'img','title'=>'导航图片'),							
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
			array(
				'title'=>'底部导航',
					'list'=>array(
									array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),							
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标','help'=>'图标，例如：icon-shouye'),							
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
					)
			),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}
/*******basic*******/
/*******op*******/
